package com.ywjt.pinkelephant.widget;

import android.view.View;
import android.widget.TextView;

import com.ywjt.pinkelephant.R;
import com.ywjt.pinkelephant.base.BaseBottomDialog;


public class PickWithDrawMethodDialog extends BaseBottomDialog {

    private TextView tvCard;
    private TextView tvAli;
    private TextView tvCancel;
    private TextView tvWx;

    private ClickListenerInterface clickListenerInterface;

    public interface ClickListenerInterface {
        void card();

        void ali();
        void wx();
    }

    public PickWithDrawMethodDialog() {
    }

    @Override
    public int getLayoutRes() {
        return R.layout.bottom_withdraw_method;
    }

    @Override
    public void bindView(View v) {
        tvCard = v.findViewById(R.id.tvCard);
        tvAli = v.findViewById(R.id.tvAli);
        tvWx=v.findViewById(R.id.tvWx);
        tvCancel = v.findViewById(R.id.tvCancle);
        tvCard.setOnClickListener(new clickListener());
        tvAli.setOnClickListener(new clickListener());
        tvCancel.setOnClickListener(new clickListener());
        tvWx.setOnClickListener(new clickListener());
    }

    public void setClicklistener(ClickListenerInterface clickListener) {
        clickListenerInterface = clickListener;
    }

    private class clickListener implements View.OnClickListener {

        @Override
        public void onClick(View v) {
            switch (v.getId()) {
                case R.id.tvCard:
                    dismiss();
                    clickListenerInterface.card();
                    break;
                case R.id.tvAli:
                    dismiss();
                    clickListenerInterface.ali();
                    break;
                case R.id.tvCancle:
                    dismiss();
                    break;
                case R.id.tvWx:
                    clickListenerInterface.wx();
                    break;
                default:
                    break;
            }
        }
    }
}
